package com.wkbb.basic.thread;

import com.alibaba.fastjson.JSONObject;
import com.wkbb.basic.feign.TcCloudFeignService;
import com.wkbb.basic.mapper.EmployeeMapper;
import com.wkbb.basic.mapper.UserMapper;
import com.wkbb.basic.model.Employee;
import com.wkbb.basic.model.User;
import com.wkbb.basic.service.ClassInfoService;
import com.wkbb.basic.service.OrganizationService;
import com.wkbb.basic.service.TeacherManageService;
import com.wkbb.basic.service.UserFacePersonConfigService;
import com.wkbb.common.dto.ResultDTO;
import com.wkbb.common.dto.basic.UserDto;
import com.wkbb.common.dto.im.GroupUserInfoDto;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

/**
 * @author dengjingyuan
 * @date 2019-11-10 11:02
 */
@Slf4j
public class ImSaveAutoGroupUserMasterTask implements Runnable {

    private ClassInfoService classInfoService;

    private Long orgId;

    private Short userType;

    private Long classId;

    private Employee employee;

    private User user;






    public ImSaveAutoGroupUserMasterTask(ClassInfoService classInfoService,Long orgId,Short userType,Long classId,Employee employee,User user) {
        this.classInfoService = classInfoService;
        this.orgId = orgId;
        this.userType = userType;
        this.classId = classId;
        this.employee = employee;
        this.user = user;

    }

    public ImSaveAutoGroupUserMasterTask() {

    }

    @Override
    public void run() {
        log.info("*********ImSaveAutoGroupUserMasterTask********classInfoService:{},orgId:{},userType:{},classId:{},employee:{}", classInfoService, orgId,userType,classId,employee,user);
        try {
            log.info("----------准备调用园长入群,如果classId有值,只同步园长进入一个群--------classId-{}",classId);
            Thread.sleep(500);
            classInfoService.saveAutoGroupUserMaster( orgId,  userType,  classId, employee,user);
        } catch (Exception e) {
            log.error("*******ImSaveAutoGroupUserMasterTask**********classInfoService:{},saveAutoGroupUserMaster:{}", e);
        }
    }
}
